home *** CD-ROM | disk | FTP | other *** search
/ Family Forum 262 / SOMC Family Forum 262.iso / Xtras / Widget Wizard / Widget Wizard.dir / WidgtBehaviors_13_go a marker-2 picts.ls < prev    next >
Encoding:
Text File  |  1997-05-10  |  2.2 KB  |  81 lines

  1. property UpCM, DownCM, button_active, whichevent, whichLabel
  2.  
  3. on getPropertyDescriptionList
  4.   set description to [:]
  5.   if the currentSpriteNum = 0 then
  6.     set memdefault to 0
  7.   else
  8.     set memref to the member of sprite the currentSpriteNum
  9.     set castLibNum to the castLibNum of memref
  10.     set memdefault to member (the memberNum of member memref + 1) of castLib castLibNum
  11.   end if
  12.   addProp(description, #DownCM, [#default: memdefault, #format: #bitmap, #comment: "Pict for Down:"])
  13.   addProp(description, #whichevent, [#default: #mouseUp, #format: #symbol, #comment: "Go To Marker On Which Event:", #range: [#mouseUp, #mouseDown, #mouseEnter, #mouseLeave, #mouseUpOutSide]])
  14.   addProp(description, #whichLabel, [#default: EMPTY, #format: #marker, #comment: "Goto which marker label:"])
  15.   return description
  16. end
  17.  
  18. on getBehaviorDescription
  19.   return "Button, auto set up pict, switch pict down, go to a specified label on user defined event"
  20. end
  21.  
  22. on getAssocMembers
  23.   set myPropList to [DownCM]
  24.   return myPropList
  25. end
  26.  
  27. on beginSprite me
  28.   set the UpCM of me to the member of sprite the spriteNum of me
  29.   set the button_active of me to 0
  30.   puppetSprite(the spriteNum of me, 1)
  31. end
  32.  
  33. on endSprite me
  34.   puppetSprite(the spriteNum of me, 0)
  35. end
  36.  
  37. on do_it me
  38.   go(label(the whichLabel of me))
  39. end
  40.  
  41. on mouseDown me
  42.   set the member of sprite the spriteNum of me to member the DownCM of me
  43.   set the button_active of me to 1
  44.   if the whichevent of me = #mouseDown then
  45.     do_it(me)
  46.   end if
  47. end
  48.  
  49. on mouseUp me
  50.   set the member of sprite the spriteNum of me to member the UpCM of me
  51.   set the button_active of me to 0
  52.   if the whichevent of me = #mouseUp then
  53.     do_it(me)
  54.   end if
  55. end
  56.  
  57. on mouseUpOutSide me
  58.   set the button_active of me to 0
  59.   if the whichevent of me = #mouseUpOutSide then
  60.     do_it(me)
  61.   end if
  62. end
  63.  
  64. on mouseLeave me
  65.   if the button_active of me then
  66.     set the member of sprite the spriteNum of me to member the UpCM of me
  67.   end if
  68.   if the whichevent of me = #mouseLeave then
  69.     do_it(me)
  70.   end if
  71. end
  72.  
  73. on mouseEnter me
  74.   if the button_active of me then
  75.     set the member of sprite the spriteNum of me to member the DownCM of me
  76.   end if
  77.   if the whichevent of me = #mouseEnter then
  78.     do_it(me)
  79.   end if
  80. end
  81.